import java.util.Scanner;

public class demo02 {
    //猴子分桃
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        while (sc.hasNext()) {
            long n = sc.nextInt();
            if (n == 0) {
                break;
            }
            long a=(long)(Math.pow(5,n)-4);
            long b=(long)(Math.pow(4,n)+n-4);
            System.out.println(a+" "+b);
        }
    }
}